package com.tencent.servlet;

import com.tencent.myssm.ViewBaseServlet;
import com.tencent.pojo.Student;
import com.tencent.service.StudentServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: Fame
 * @date: 2022-06-21 17:31
 * @description:
 */
@WebServlet("/edit.dao")
public class EditServlet extends ViewBaseServlet {

    StudentServiceImpl service = new StudentServiceImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer id = Integer.valueOf(req.getParameter("fid"));

        Student student = service.getBean(id);
        req.setAttribute("student",student);
        super.processTemplate("edit",req,resp);

    }
}
